/*
 * Copyright 2013 Fabian Gilson. This file is part of Online Library academic project and it is free software: you can redistribute it and/or modify it under the
 * terms of the GNU General Public License version 3 as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details. see <http://www.gnu.org/licenses/>.
 */

package unamur.iodass.communication.messages;


/**
 * This class represents a book.
 * 
 * 
 * @author Fabian Gilson
 * 
 * 
 */
public class Book extends Message {

	/**
	 * book title
	 */
	private final String title;

	/**
	 * book author
	 */
	private final String author;

	/**
	 * book language
	 */
	private String language = "";

	/**
	 * book ISBN (exactly 10 or 13 digits)
	 */
	private final long isbn;
	
	
	/**
	 * Price of book
	 */
	private int price;
	
	/**
	 * Constructor
	 * 
	 * @param title
	 *           the title
	 * @param author
	 *           the author
	 * @param isbn
	 *           the ISBN number (exactly 10 or 13 digits)
	 */
	public Book(String title, String author, long isbn) {
		this.title = title;
		this.author = author;
		this.isbn = isbn;
	}

	/**
	 * Constructor
	 * 
	 * @param title
	 *           the title
	 * @param author
	 *           the author
	 * @param language
	 *           the book language
	 * @param isbn
	 *           the ISBN number (exactly 10 or 13 digits)
	 */
	public Book(String title, String author, String language, long isbn) {
		this.title = title;
		this.author = author;
		this.language = language;
		this.isbn = isbn;
	}

	/**
	 * 
	 * @return the book title
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * 
	 * @return the book author
	 */
	public String getAuthor() {
		return author;
	}

	/**
	 * 
	 * @return the book language
	 */
	public String getLanguage() {
		return language;
	}

	/**
	 * set the book language
	 * 
	 * @param language
	 *           the book language
	 */
	public void setLanguage(String language) {
		this.language = language;
	}

	/**
	 * 
	 * @return the ISBN number (exactly 10 or 13 digits)
	 */
	public long getIsbn() {
		return isbn;
	}
	
	/**
	 * @return the price of the book
	 */
	public int getPrice() {
		return price;
	}
	
	/**
	 * set price of the book
	 */
	public void setPrice(int price) {
		this.price = price;
	}
	
	@Override
	public String toString() {
		return "title: " + title + "\tauthor: " + author + "\tlanguage: " + language + "\tISBN: " + isbn;
	}

}
